<?php 
// Lay cac thong so cau hinh chung
include "../../app_global.php";
// Lay cac hang so dung chung
include "../../const.php";
// Ham thuc hien lay ten file va hien thi noi dung
include "../../isa-lib/isa-function/isa_public_function.php";
require_once("../../isa-lib/nusoap/nusoap.php");
include "../../isa-lib/isa-function/prax.php";
// Kiem tra NSD da login hay qua timeout chua
include "../../test_login.php";
//Ket noi CSDL
include "../../connect.php";
include "../../connect_ado.php";
// Khoi tao cac bien SESSION chua quyen modul, function cua NSD
include "../../init_session.php";
// Lay cac thong so cau hinh rieng cho chuc nang nay
include "../../onegate_function.php";
include "app_local.php";
include "const.php";
include "../handle/const.php";
include "../receive/const.php";
include_once $FOLDER_DEVEDIT_CLASS;
// Lay cac hang so cua chuc nang nay
if (!isset($_REQUEST['modal_dialog_mode'])) {
	include "../../dsp_header.php";
}else{
	include "../../dsp_modal_dialog_header.php";
}
?>
<script src="../../isa-lib/isa-js/isa_util.js" ></script>
<script src="../handle/js_record_handle.js" ></script>
<script src="../receive/js_record.js" ></script>
<script src="js_record_result.js" ></script>
<?php
//echo $fuseaction.'<br>';
switch($fuseaction) {
	case "DISPLAY_ALL_LICENCE_RECORD";
	//echo "1";
		$v_detail_status_compare = " And C_DETAIL_STATUS<>51 ";
		$v_status_list = "CAP_PHEP,TU_CHOI";
		$v_fuseaction_onclick = "DISPLAY_SINGLE_LICENCE_RECORD";
		$v_title = CONST_RECORD_RESULT_TITLE;
		$v_worktype = "TRA_KET_QUA";
		$v_show_date = false;
		$v_receive_date = "";
		$v_xml_file_list = "danh_sach_ho_so_cho_tra_ket_qua.xml";
		include "../record-lib/qry_all_recordtype_by_staff.php";
		include "../record-lib/qry_all_record.php";
		include "../record-lib/dsp_all_record.php";
		break;
	case "DISPLAY_SINGLE_LICENCE_RECORD";
//echo "2";
		include "../record-lib/qry_single_record.php";
		include "qry_single_recordtype.php";
		include "dsp_single_licence_record.php";
		break;
	case "UPDATE_LICENCE_RECORD";
//echo "3";
		include "act_update_licence_record.php";
		break;
	case "DISPLAY_SINGLE_RECORD";
//echo "4";
		include "../record-lib/qry_single_record.php";
		include "../record-lib/dsp_single_record.php";
		break;
	case "DISPLAY_SINGLE_RECORD_CONTENT";
//echo "5";
		$v_title = CONST_RECORD_CONTENT_TITLE;
		include "../record-lib/qry_single_record.php";
		include "../record-lib/dsp_single_record.php";
		break;
	//Them cac fuseaction ben handle vao
	case "DISPLAY_ALL_RECORD_WORK";
//echo "6";
		include "../record-lib/qry_single_record.php";
		include "../handle/qry_all_record_work.php";
		include "../handle/dsp_all_record_work.php";
		break;
	case "DISPLAY_SINGLE_RECORD_WORK";
//echo "7";
		include "../record-lib/qry_single_record.php";
		include "../handle/qry_all_worktype.php";
		include "../handle/qry_single_record_work.php";
		include "../handle/dsp_single_record_work.php";
		break;
	case "DELETE_RECORD_WORK";
//echo "8";
		include "../handle/act_delete_record_work.php"; 
		break;
	case "UPDATE_RECORD_WORK";
//echo "9";
		include "../handle/act_update_record_work.php";
		break;
	case "DISPLAY_ALL_RECORD_DOC";
//echo "10";
		include "../record-lib/qry_single_record.php";
		include "../handle/qry_all_record_doc.php";
		include "../handle/dsp_all_record_doc.php";
		break;
	case "DISPLAY_SINGLE_RECORD_DOC";
//echo "11";
		include "../record-lib/qry_single_record.php";
		include "../handle/qry_single_record_doc.php";
		include "../handle/dsp_single_record_doc.php";
		break;
	case "UPDATE_RECORD_DOC";
//echo "12";
		include "../handle/act_update_record_doc.php";
		break;
	case "DELETE_RECORD_DOC";
		include "../handle/act_delete_record_doc.php"; 
		break;
	case "DISPLAY_SINGLE_IDEA";
		include "../handle/qry_single_idea.php";
		include "../handle/dsp_single_idea.php";
		break;
	case "DISPLAY_ALL_IDEA";
		include "../record-lib/qry_single_record.php";
		include "../handle/qry_all_idea.php";
		include "../handle/dsp_all_idea.php";
		break;
	case "DELETE_IDEA";
		include "act_delete_idea.php"; 
		break;
	case "UPDATE_IDEA";
		include "../handle/act_update_idea.php";
		break;
	case "DISPLAY_SINGLE_LICENSE";
		include "../handle/qry_single_license.php";
		include "../handle/dsp_single_license.php";
		break;
	case "UPDATE_LICENSE";
		include "../handle/act_update_license.php";
		break;
	case "DISPLAY_MULTIPLE_RECORD_FOR_SEND_MAIL";
		include "qry_all_selected_id_record.php";
		include "dsp_all_record_for_send_mail.php";
		break;
	case "SENDING_EMAIL";
		include "act_send_email.php";
		break;
	case "DISPLAY_KYNHANTRAKETQUA";
		include "qry_single_record.php";
		include "qry_all_worktype.php";
		include "qry_single_record_work.php";
		include "dsp_single_record_work.php";
		break;
	//DatCQ: Hien thi dialog de xac nhan ky nhan ho so tiep nhan tra ket qua
	case "DISPLAY_SIGN_RECEIPT_RECORD_NHSG_KQ_HSTKQ";
		$v_result = _CONST_NHSG_KQ_HSTKQ;
		$v_worktype = "NHSG_KQ_HSTKQ";
		$v_title = CONST_NAME_SIGN_RECEIPT_TITLE_NHSG_KQ_HSTKQ;
		include "../record-lib/qry_single_record_sign_receipt.php";
		include "qry_single_recordtype.php";
		include "../receive/dsp_sign_receipt_record.php";
		break;		
	case "UPDATE_SIGN_RECEIPT_RECORD";
		include "../receive/act_update_sign_receipt_record.php";
		break;			
	//////////////////////////////////////////////////////////////////
	default:
		$v_detail_status_compare = " And C_DETAIL_STATUS<>51 ";
		$v_status_list = "CAP_PHEP,TU_CHOI,RUT_HO_SO";
		$v_fuseaction_onclick = "DISPLAY_SINGLE_LICENCE_RECORD";
		$v_title = CONST_RECORD_RESULT_TITLE;
		$v_worktype = "TRA_KET_QUA";
		$v_show_date = false;
		$v_receive_date = "";
		$v_xml_file_list = "danh_sach_ho_so_cho_tra_ket_qua.xml";
		include "../record-lib/qry_all_recordtype_by_staff.php";
		include "../record-lib/qry_all_record.php";
		include "../record-lib/dsp_all_record.php";
		break;
}
include "../../disconnect.php";
if (!isset($_REQUEST['modal_dialog_mode'])) {
	include "../../dsp_footer.php";
}else{
	include "../../dsp_modal_dialog_footer.php";
}?>